package com.student.db;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

//公告
@Entity(tableName = "db_push")
public class PushEntity implements Parcelable {
    @NonNull
    @PrimaryKey
    private Long id;
    private String imagePath;
    private String title;
    private String content;
    private String roomNo;
    private String pushTime;

    @NonNull
    public Long getId() {
        return id;
    }

    public void setId(@NonNull Long id) {
        this.id = id;
    }

    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }

    public String getRoomNo() {
        return roomNo;
    }

    public void setRoomNo(String roomNo) {
        this.roomNo = roomNo;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getPushTime() {
        return pushTime;
    }

    public void setPushTime(String pushTime) {
        this.pushTime = pushTime;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeString(this.imagePath);
        dest.writeString(this.title);
        dest.writeString(this.content);
        dest.writeString(this.roomNo);
        dest.writeString(this.pushTime);
    }

    public void readFromParcel(Parcel source) {
        this.id = (Long) source.readValue(Long.class.getClassLoader());
        this.imagePath = source.readString();
        this.title = source.readString();
        this.content = source.readString();
        this.roomNo = source.readString();
        this.pushTime = source.readString();
    }

    public PushEntity() {
    }

    protected PushEntity(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.imagePath = in.readString();
        this.title = in.readString();
        this.content = in.readString();
        this.roomNo = in.readString();
        this.pushTime = in.readString();
    }

    public static final Parcelable.Creator<PushEntity> CREATOR = new Parcelable.Creator<PushEntity>() {
        @Override
        public PushEntity createFromParcel(Parcel source) {
            return new PushEntity(source);
        }

        @Override
        public PushEntity[] newArray(int size) {
            return new PushEntity[size];
        }
    };
}
